/**
 * Created by WUJO5 on 2/23/2018.
 */
var express = require('express');
var router = express.Router();
var reportCtrl = require('../controller/reportController');

router.get('/total/:automationId',function (req,res) {
    reportCtrl.getSummaryById(req.params,function (data) {
        res.send(data)
    },function(err){
        res.send(err);
    })
});

router.get('/detail/:automationId',function(req,res){
    reportCtrl.getDetailById(req.params,function(data){
        res.send(data);
    },function(err){
        res.send(err);
    })
});

router.get('/:automationId/:testCaseName',function(req,res){
    console.log('automationId ',req.params.automationId)
    reportCtrl.getDetailBytestCaseName(req.params,function(data){
        res.send(data);
    },function(err){
        res.send(err);
    })
});

router.post('/summary/add', reportCtrl.addReportSummary);
router.post('/detail/add', reportCtrl.addReportDetail);

module.exports = router;
